2 program problem100 (input, output);
\r
4 {$IFNDEF ONLINE_JUDGE}
\r
11 function getCycleLength(N: integer): integer;
\r
15 while N <> 1 do begin
\r
16 if odd(N) then N := 3*N + 1
\r
20 getCycleLength := k;
\r
23 function getMaxCycleLength(i, j: integer): integer;
\r
25 max, curCL: integer;
\r
28 for k:=i to j do begin
\r
29 curCL := getCycleLength(k);
\r
30 if curCL > max then max := curCL;
\r
32 getMaxCycleLength := max;
\r
36 while not eof(input) do begin
\r
38 write(i, ' ', j, ' ');
\r
40 writeln(getMaxCycleLength(i, j))
\r
42 writeln(getMaxCycleLength(j, i));
\r